/*=============================================================================
#    The element-comm is a tentative program used to test our ideas.           
#                       Copyright (C)  bgao                                    
#
#     This program is free software; you can redistribute it and/or            
#      modify it under the terms of the GNU General Public License             
#     as published by the Free Software Foundation; either version 2           
#         of the License, or (at your option) any later version.               
#
#     This program is distributed in the hope that it will be useful,          
#    but WITHOUT ANY WARRANTY; without even the implied warranty of           
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            
#             GNU General Public License for more details.                    
#
#    You should have received a copy of the GNU General Public License        
#     along with this program; if not, write to the Free Software             
#      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,             
#                       MA  02110-1301, USA.                                  
#==============================================================================
# $Id: sub_timer.h 348 2010-11-29 09:01:16Z bgao $ 
#
# $Author: bgao $ 
#
# $Revision: 348 $ 
#
# $Date: 2010-11-29 17:01:16 +0800 (星期一, 29 十一月 2010) $ 
#
# Description: 
#
=============================================================================*/
/*! @file sub_timer.h
 *  @brief In order to adapt to the timer interfaces provided
 *         by the OS, this file defines a timer strcut for the OS.
 */
#ifndef _SUB_TIMER_H_
#define _SUB_TIMER_H_

/* this provide a vitual interface for timer to make it independent of the implementation */
/* TODO place this header under os dir for each timer implementation */
/* include the real timer implementation */

/* tentative for compile */

#if 0 /* for unit test */
struct sub_timer_t {
};
#endif

struct wsn_timer;
/*! the timer callback function type for OS */
typedef void (*timer_func)(struct wsn_timer * timer);

/*! the timer structure for OS */
struct wsn_timer {
    timer_func	func;
    uint16		expire;
    uint8		index;
};

/*! the package of OS timer structure */
struct sub_timer_t {
    struct wsn_timer wtimer;
};

#endif
